README File for:

"People Consistently View Elections and Civil Liberties as Key Components of Democracy"
Version: August 24, 2024

For a full description of the methodology and research procedures, please see the main paper and supplementary appendix.



LIST OF REPLICATION MATERIALS, Folders A through D
**************************************************

A. Folder "data_cleaning":

In this folder, you'll find the raw data and our R code for cleaning the raw data. You do not need to go through this folder prior to conducting the analyses in the other folders: instead, this folder is just for those interested in how we arrived at our cleaned data sets.

   1. "raw_EG.csv", "raw_IN.csv", "raw_IT.csv", "raw_JP.csv", "raw_TH.csv", "raw_US.csv": raw datasets for each country sample
   2. "clean_raw_EG.csv", "clean_raw_IN.csv", "clean_raw_IT.csv", "clean_raw_JP.csv", "clean_raw_TH.csv", "clean_raw_US.csv": R scripts to clean the raw datasets
   3. "df_EG.csv", "df_IN.csv", "df_IT.csv", "df_JP.csv", "df_TH.csv", "df_US.csv": cleaned datasets produced by the R scripts in (2)



B. Folder "all_countries":

This folder includes R code used to produce various figures and tables in the main paper and appendix involving AGGREGATE analysis of all six countries at once.

   1. "main_analysis.R": R scripts to produce Figures 1-3, Figures S2-S4, Figures S11-S13, Figure S21, and Table S5
   2. "remove_ties.R": R scripts to produce Figure S1
   3. "cjRank.R": R scripts to produce Figure S14 and Table S6



C. Folder "individual_country":

This folder includes R code used to produce various figures and tables in the main paper and appendix involving INDIVIDUAL analysis of each of the six countries separately.

   1. "additional_EG.R", "additional_IN.R", "additional_IT.R", "additional_JP.R", "additional_TH.R", "additional_US.R": R scripts to produce Figures S3-S8 and Figures S15-S20
   2. "labels_original_EG.csv", "labels_original_IN.csv", "labels_original_IT.csv", "labels_original_JP.csv", "labels_original_TH.csv", "labels_original_US.csv": intermediate CSV files produced by the R scripts in (1)
   3. "labels_arranged_EG.csv", "labels_arranged_IN.csv", "labels_arranged_IT.csv", "labels_arranged_JP.csv", "labels_arranged_TH.csv", "labels_arranged_US.csv": CSV files edited from the CSV files in (2); useful for producing Figures S5-S10 using the projoint package



D. Folder "demographics":

This folder includes R code to analyze demographic information in the surveys.

   1. "demographics.R": R script to produce the information in Table S4



----------------------------------------------------------------------------------------------------
Note: The replication was done with RStudio version 2023.06.1+524, and with the following R version:

platform       x86_64-apple-darwin17.0     
arch           x86_64                      
os             darwin17.0                  
system         x86_64, darwin17.0          
status                                     
major          4                           
minor          0.1                         
year           2020                        
month          06                          
day            06                          
svn rev        78648                       
language       R                           
version.string R version 4.0.1 (2020-06-06)
nickname       See Things Now 